package snafu.framework.agents;

import snafu.framework.actions.AbstractAction;
import snafu.framework.actions.AbstractReaction;
import snafu.framework.worlds.WorldMap;

public abstract class AgentBrain {

	/**
	 * Returns the next action the brain wants to perform depending on the current perception and
	 * the current state.
	 * 
	 * @param perception
	 *            the perception of the world
	 * @param state
	 *            the current state of the agent the brain belongs to
	 * @return the next action, EmptyAction if none
	 */
	public abstract AbstractAction act(WorldMap perception, AgentState state);
	
	/**
	 * Returns the initial state of the brain.  
	 * 
	 * @return the state filled with literals and intentions
	 */
	public abstract AgentStateItself getInitialState();
	
	/**
	 * Return the action the brain wants to perform on a given reaction
	 * 
	 * @param action
	 *            the action that was perform with the agent the brain belongs to
	 * @return an reaction
	 */
	public abstract AbstractReaction react(AbstractAction action);
	
	public abstract String output();
	
	@Override
	public String toString() {
		return output();
	}
}
